package com.diligent.cloud.sfc.resources;

import com.canny.commons.model.ObjectResult;
import com.canny.commons.model.Result;
import com.diligent.cloud.sfc.model.OrderCompleteParams;
import com.diligent.cloud.web.resource.IBaseResource;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*;

import java.security.Principal;

/**
 * WorkshopScenePackingResource interface
 * 车间现场包装
 * @author xf107278
 * @date 4/20/2020
 */
@RequestMapping("/sfc-workshop-scene-packing")
public interface WorkshopScenePackingResource extends IBaseResource {

    @GetMapping("/lots-filter")
    @ApiOperation(value = "车间现场/获取扎号列表", notes = "车间现场/获取扎号列表"  , tags = "车间现场")
    ResponseEntity<Result>getLotsFilter( @RequestParam(value = "machCode")String machCode, @AuthenticationPrincipal Principal principal);

    @PostMapping("/cancel-lots")
    @ApiOperation(value = "车间现场/取消扎号", notes = "车间现场/取消扎号"  , tags = "车间现场")
    ResponseEntity<ObjectResult> cancelLots(Long lotsId, @AuthenticationPrincipal Principal principal);

    @GetMapping("/last-order")
    @ApiOperation(value = "车间现场/最后一个已完工信息", notes = "车间现场/最后一个已完工信息"  , tags = "车间现场")
    ResponseEntity<ObjectResult> getLastOrder(@RequestParam(value = "machCode")String machCode, @AuthenticationPrincipal Principal principal);


    @PostMapping("/lots")
    @ApiOperation(value = "车间现场/新增扎号", notes = "车间现场/新增扎号"  , tags = "车间现场")
    ResponseEntity<ObjectResult> addLots(@RequestBody OrderCompleteParams orderCompleteParams, @AuthenticationPrincipal Principal principal);

}
